function quiver_func2D(func, region, h, varargin)
% Drawing the vector field of the vector function in 2D case.
% quiver_func(@obj_func, region, h[, args]);
% region = [x_start, x_stop, y_start, y_end];
% h is the resolusion.
% args are the parameters for quiver, e.g., the dimension of the local vector.

    xN = ceil(region(2) - region(1)) / h;
    yN = ceil(region(4) - region(3)) / h;
    if (xN < 3 || yN < 3)
        disp ("Not enough resolution.");
        return;
    end
    N = xN * yN;
    x = linspace(region(1), region(2), xN);
    y = linspace(region(3), region(4), yN);
    [X, Y] = meshgrid(x, y);
    vx = reshape(X, 1, N);
    vy = reshape(Y, 1, N);
    fx = [vx; vy];
    vz = func(fx);
%    if (size(vz, 1) ~= 2)
%        disp ("For 2D vector function only.");
%        return;
%    end
    U = reshape(vz(1, :), yN, xN);
    V = reshape(vz(2, :), yN, xN);
    quiver(X, Y, U, V, varargin{:});
end